On the current Internet, communication between terminals, between network elements, and between a terminal and a network element need to be performed by using Internet Protocol (IP) addresses. From the perspective of a function of an IP address, the IP address has double semantics: In terms of network topology, the IP address indicates a topological location of a terminal when the terminal accesses a network; in terms of application, the IP address represents the identity of the terminal.
When a first terminal and a second terminal are performing service communication, they know each other's IP addresses. If the first terminal moves, the topological location where it gets access to the network also changes, and its IP address needs to change accordingly. However, the second terminal cannot know the change of the IP address of the first terminal. For the second terminal, it always deems that an IP address known by it corresponds to the first terminal. This causes the interruption of the service communication and affects the communication experience between users.
To solve a problem of communication interruption caused by the problem of the double semantics of the IP address, in the prior art, a manner relying on a third party application server is adopted to solve a problem of continuous communication between users. Two terminals expecting to establish communication may be connected through the third party application server, and the third party application server performs service message forwarding between the two terminals. One of the two terminals expecting to establish communication may also obtain the IP address of the other terminal from the application server and then perform the communication. The third party application server is generally provided by a service provider and includes but is not limited to instant messaging (IM), Twitter, electronic mail (Email), Tencent QQ instant messaging (QQ), and so on.
A communication process relying on the third party server is briefly described as follows: A user registers on the application server and obtains an identifier of the application server, that is, the user obtains an identifier from the application server, for example, a QQ number; the user logs in to the application server by using the application identifier, and the application server obtains an IP address of the user; when another user needs to contact the user, the IP address of the user is obtained through forwarding by the application server or directly from the application server, so as to establish communication; the application server needs a periodic application heartbeat to maintain IP reachability of the user, where the period is determined according to an actual situation and generally ranges from one minute to more than ten minutes. In communication relying on the third party application server, a Push technology may be used. The third party application server is used to push a message to a terminal user who maintains the IP reachability by using a heartbeat mechanism.
The communication manner relying on the third party application server restrains conditions for communication between two communication parties. First, users of both parties should actively initiate communication with the third party application server to maintain the IP reachability with the third party application server; otherwise, the third party application server cannot find the users; second, without the third party application server, the communication between the two communication parties is difficult to start or continue; third, to rely on the third party application server, a user terminal should enable an application client and keep it online all the time, which increases the power consumption of the terminal and reduces the performance of the terminal.